package com.bileetacrm;

import android.os.Bundle;
import android.os.CountDownTimer;
import android.app.Activity;
import android.content.Intent;
import android.database.sqlite.SQLiteDatabase;
import android.view.Menu;
import android.view.Window;
import android.view.WindowManager;

public class BileetaSplashScreen extends Activity {
	private String DATABASE_NAME = "bileetacrm.db";
	private SQLiteDatabase mydb;
	private static final int DATABASE_VERSION = 1;
	BileetaCRMDBLoader db;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		this.requestWindowFeature(Window.FEATURE_NO_TITLE);
		this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
				WindowManager.LayoutParams.FLAG_FULLSCREEN);
		setContentView(R.layout.bileeta_splash_screen);

		db = new BileetaCRMDBLoader(this);
		db.getWritableDatabase();
		new CountDownTimer(5000, 1000) {

			public void onTick(long millisUntilFinished) {

			}

			public void onFinish() {
				Intent myIntent = new Intent(getBaseContext(),
						BileetaLoginActivity.class);
				myIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP
						| Intent.FLAG_ACTIVITY_NEW_TASK);
				startActivityForResult(myIntent, 0);
				overridePendingTransition(R.anim.anim_slide_in_left,
						R.anim.anim_slide_out_left);
			}
		}.start();

	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.bileeta_splash_screen, menu);
		return true;
	}

}
